public class Student
{
    public static final int
            HTML = 0, PLAIN = 1;
    
    public Student()
    {
    }

    String name;
    String email;
    int preferredFormat;
    Team team = null;

    public String getLastName()
    {
        if (name.contains(","))
            return name.substring(0,name.indexOf(",")).trim();
        else return name.trim();
    }

    public String getFirstName()
    {
        if (name.contains(","))
        {
            String nonLast = name.substring(name.indexOf(",")+1, name.length()).trim();
            if (nonLast.contains(" ")) return nonLast.substring(0, nonLast.indexOf(" "));
            else return nonLast;
        }
        else return name.trim();
    }
}
